const App = {
    mixins: [Query],//配置文件，路径/utils/mixins.js
    data() {
        return {
            treeNode:'',
            page: {
                PageNumber: 1, //页码
                RowAmount: 10,
                Condition: window.btoa(unescape(encodeURIComponent("%%"))),
                ExtensionCondition:''
            },
        }
    },
    mounted() {

    },
    methods: {
        check(){
            if(this.page.value1){
                this.page.Condition = window.btoa(unescape(encodeURIComponent("%" + this.page.value1 + "%")));
            } else {
                this.page.Condition = window.btoa(unescape(encodeURIComponent("%%")));
            }
            this.postgetList(this.page)
        },
        personalAdd() {
            window.location.href = "./add.html?action=Add" + (this.treeNode?"&treeNode="+this.treeNode:"");
        },
        //树的点击筛选事件
        handleNodeClick(data, node) {
            this.treeNode = '';
            let treeNode = data.Natural_Resource_Usage_SerialNumber;
            if (node.level==1) {
                this.page.ExtensionCondition = window.btoa(unescape(encodeURIComponent("AND d.Natural_Resource_Usage_SerialNumber='"+treeNode+"'")));
            } else  if (node.level==2) {
                this.page.ExtensionCondition = window.btoa(unescape(encodeURIComponent("AND c.Natural_Resource_Usage_SerialNumber='"+treeNode+"'")));
            } else  if (node.level==3) {
                this.page.ExtensionCondition = window.btoa(unescape(encodeURIComponent("AND b.Natural_Resource_Usage_SerialNumber='"+treeNode+"'")));
            } else  if (node.level==4) {
                this.treeNode = treeNode;
                this.page.ExtensionCondition = window.btoa(unescape(encodeURIComponent("AND a.Natural_Resource_Usage_SerialNumber='"+treeNode+"'")));
            }
            this.postgetList(this.page)
        },
    },
};

const { createApp } = Vue;
const app = createApp(App);
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
const ElMessage = ElementPlus.ElMessage;
app.use(ElementPlus, { locale: zhCn });
app.mount("#app");
